package rewrite.service.impl;

import static cn.hutool.poi.excel.sax.AttributeName.s;

import cn.hutool.core.text.StrFormatter;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import rewrite.common.Label;
import rewrite.common.StyleEnum;
import rewrite.service.ReWriteService;

public class ReWriteServiceImpl implements ReWriteService {

    private static HashMap<Integer,String> map1 = new HashMap<>();
    private static HashMap<Integer,String> map2 = new HashMap<>();
    private static HashMap<Integer,String> map3 = new HashMap<>();

    @Override
    public void getAllPassage(String title) {
        // 1 分成10个段
        StringBuilder builder = new StringBuilder();

        // 1
        List<Label> labels = StyleEnum.toLabelList();

        String style = labels.get(RandomUtil.randomInt(0, 9)).getText();
        builder.append(StrFormatter.format("这是一款({})({})的手游。",title,style));
        builder.append(StrFormatter.format("游戏里玩家({})一名({})",map2,map3));



    }

    /*@Override
    public List<TFormulaTemplateDTO> selectByTemName(TFormulaTemplateDTO dto) {
        List<TFormulaTemplate> list = this.service.list(new QueryWrapper<TFormulaTemplate>()
                .eq("status", NumberConstants.ONE)
                .like(StringUtils.isNotBlank(dto.getTemplateName()), "template_name", dto.getTemplateName())
                .groupBy("template_no"));
        ArrayList<TFormulaTemplateDTO> temPOList = new ArrayList<>();
        list.forEach(obj->{
            temPOList.add(this.to(obj));
        });
        return temPOList;
    }*/
    private void mapPut(){
        map1.put(0,"轻松类");
        map1.put(1,"休闲类");
        map1.put(2,"刺激类");
        map1.put(3,"冒险类");
        map1.put(4,"闯关类");
        map1.put(5,"轻松类");
        map1.put(6,"轻松类");

        map2.put(0,"扮演");
        map2.put(1,"充当");
        map2.put(2,"是");
        map2.put(3,"为");
        map2.put(4,"可以是");
        map2.put(5,"扮演的是");
        map2.put(6,"充当的是");
        map2.put(7,"其实是");
        map2.put(8,"意料之中的是");

        map3.put(0,"热血的");
        map3.put(1,"智慧的");
        map3.put(2,"聪明的");
        map3.put(3,"聪慧的");
        map3.put(4,"明智的");
        map3.put(5,"冷静的");
        map3.put(6,"冷酷的");
        map3.put(7,"活泼的");
        map3.put(8,"开朗的");
        map3.put(9,"稳重的");
        map3.put(10,"有毅力的");
        map3.put(11,"自信的");
        map3.put(12,"坚强的");
        map3.put(13,"理智的");
        map3.put(14,"有干劲的");
        map3.put(15,"团结的");
        map3.put(16,"善良的");
        map3.put(17,"耐心的");
        map3.put(18,"细致的");
        map3.put(19,"热情的");
        map3.put(20,"认真的");


    }
}
